package com.yupi.yupao.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yupao.model.domain.Team;
import com.yupi.yupao.model.domain.User;
import com.yupi.yupao.model.dto.TeamQuery;
import com.yupi.yupao.model.request.TeamJoinRequest;
import com.yupi.yupao.model.request.TeamQuitRequest;
import com.yupi.yupao.model.request.TeamUpdateRequest;
import com.yupi.yupao.model.vo.TeamUserVO;

import java.util.List;

/**
 * @author ROG
 * @description 针对表【team(队伍)】的数据库操作Service
 * @createDate 2025-02-08 22:13:37
 */
public interface TeamService extends IService<Team> {

    /**
     * 添加队伍 业务逻辑接口
     *
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * 搜索队伍 业务逻辑接口
     *
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery, boolean isAdmin);

    /**
     * 获取我创建的队伍 业务逻辑接口优化
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeamsNew(TeamQuery teamQuery, boolean isAdmin);
    /**
     * 获取我创建的队伍列表id
     *
     * @return
     */
    List<Long> getTeamByMyself(TeamQuery teamQuery, boolean isAdmin);

    /**
     * 更新队伍
     *
     * @param teamUpdateRequest
     * @param loginUser
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest, User loginUser);

    /**
     * 用户加入队伍业务逻辑接口
     *
     * @param team
     * @param loginUser
     * @return
     */
    boolean joinTeam(TeamJoinRequest team, User loginUser);

    /**
     * 用户退出队伍业务逻辑接口
     *
     * @param team
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest team, User loginUser);

    /**
     * 删除（解散）队伍
     *
     * @param id:队伍id
     * @param loginUser:当前登录用户
     * @return
     */
    boolean deleteTeam(long id, User loginUser);
}
